from Tkinter import *
#def change_text():
#    depll=depot.get()
#    description.insert(0, depll)
def save_text():
    fileD = open ("delivers.txt","a")
    fileD.write("Depot:\n")
    fileD.write("%s\n" % depot.get())
    fileD.write("description:\n")
    fileD.write("%s\n" % description.get())
    fileD.write("Address:\n")
    fileD.write("%s\n" % address.get("1.0",END))
    #depot.delete(0, END)
    depot.set(None)
    description.delete(0, END)
    address.delete("1.0", END)

def read_depots(file):
    depots=[]
    fileR = open ("depots.txt","r")
    for line in fileR:
        depots.append(line.rstrip())
    return depots

app = Tk()
app.title('Head-Ex Deliveries')

Label(app, text = "Depot:").pack()
depot = StringVar()
depot.set(None)
#Radiobutton(app, text = "Cambridge, MA", value = "Cambridge, MA", variable = depot).pack()
#Radiobutton(app, text = "Cambridge, UK", value = "Cambridge, UK", variable = depot).pack()
#Radiobutton(app, text = "Seattle, WA", value = "Seattle, WA", variable = depot).pack()
depotlist = read_depots("depots.txt")
OptionMenu(app, depot, *depotlist).pack()

Label(app,text="description:").pack()
description = Entry(app)
description.pack()

Label(app, text = "Address:").pack()
address = Text(app)
address.pack()

Button(app, text = "Save", command = save_text).pack()
app.mainloop()
